﻿using RockBus.DataContracts;
using RockBus.Hosting.Interfaces;
using RockBus.Logging.Interfaces;
using System;
using System.ServiceModel;

namespace RockBus.Hosting.Web
{
    public class WebReceivePortServiceHostFactory : IReceivePortServiceHostFactory
    {
        public WebReceivePortServiceHostFactory(ILogger logger)
        {
            this.Logger = logger;
        }

        private ILogger Logger { get; set; }

        public ServiceHostBase CreateServiceHost(ReceivePortInfo receivePortInfo, Uri[] baseAddresses)
        {
            // Create new RockBusServiceHost with dynamic endpoint
            var rsh = new DynamicServiceHost(this.Logger, receivePortInfo);
            return rsh;
        }
    }
}